import {getOrderList} from '../../assets/js/request.js'
const state = {
    orderList:JSON.parse(localStorage.getItem('orderList')) || [],
}
const mutations = {
    setOrderList(state,data) {
        state.orderList = data;
        console.log(state.orderList);
    }
    
}
const actions = {
    async getOrders({commit}) {
        let res = await getOrderList();
        console.log(res);
        commit('setOrderList',res);
    }
}
const getters = {
    
}
export default {
    namespaced: true,
    state,
    mutations,
    actions,
    getters,
}